﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace Spritehand.FarseerHelper
{
    /// <summary>
    /// Defines an instance of a collision between two sprites.
    /// It is necessary to cache collisions until the end of the Simulator's Step.
    /// </summary>
    public class CollisionInstance
    {
        public PhysicsSprite Sprite1 { get; set; }
        public PhysicsSprite Sprite2 { get; set; }

        public CollisionInstance(PhysicsSprite sprite1, PhysicsSprite sprite2)
        {
            Sprite1 = sprite1;
            Sprite2 = sprite2;
        }
    }

    /// <summary>
    /// This will keep a list of collisions for a step.
    /// </summary>
    public static class CollisionStore
    {
        public static List<CollisionInstance> Collisions = new List<CollisionInstance>();

        public static void AddCollision(PhysicsSprite sprite1, PhysicsSprite sprite2)
        {
            Collisions.Add(new CollisionInstance(sprite1, sprite2));
        }

    }
}
